package com.example.robertluozizhao.framecollectdemo.fragment;

import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.robertluozizhao.framecollectdemo.R;
import com.example.robertluozizhao.framecollectdemo.adapter.NormalTextAdapter;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * @author luo_zi_zhao
 * @version V1.0 当前版本描述信息
 * @FileName com.example.robertluozizhao.framecollectdemo.fragment
 * @date 2019/4/25 17:23
 */

public class TextFragmetManager03_01 extends BaseFragment {

    @BindView(R.id.rv)
    RecyclerView mRv;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        View view = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_manager_text03_01, null);
        ButterKnife.bind(this, view);
        initView();
        return view;
    }

    private void initView() {
        ArrayList<String> strings = new ArrayList<>();
        for (int i = 1; i < 21; i++) {
            strings.add("第"+i+"个");
        }
        mRv.setLayoutManager(new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false));
        NormalTextAdapter normalTextAdapter = new NormalTextAdapter(strings);
        mRv.setAdapter(normalTextAdapter);
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
    }

}
